home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / cc1.68k / utils.mk < prev    next >
Encoding:
Makefile  |  1991-05-23  |  2.1 KB  |  65 lines

  1. #
  2. # This Makefile is a special one for the cc1 program (the main portion of
  3. # the GNU C compiler).  The purpose of this Makefile is to generate
  4. # executable copies of several utility programs, which are then used
  5. # to generate source files for the compiler from a description of the
  6. # machine for which the compiler is to generate code.  This Makefile
  7. # must be separate from the main Makefile, and must be processed in
  8. # a separate invocation of Pmake, because its target machine must be
  9. # the machine on which we're executing now, not the machine on which
  10. # the compiler is to execute.
  11. #
  12.  
  13. MACHINES     = $(TM)
  14. SRCDIR        ?= ../cc/dist
  15. TM        ?= sun3
  16. CC        = cc
  17. LIBS        ?=
  18. XCFLAGS        ?=
  19.  
  20. .PATH.h        :
  21. .PATH.h        : ../gcc/sprite $(SRCDIR) /sprite/lib/include \
  22.             /sprite/lib/include/$(TM).md
  23.  
  24. #include    <tm.mk>
  25. CFLAGS         = -g -O $(TMCFLAGS) -I. $(.INCLUDES) $(XCFLAGS)
  26.  
  27. all        : $(TM).md/genconfig $(TM).md/genflags $(TM).md/gencodes \
  28.             $(TM).md/genemit $(TM).md/genrecog \
  29.             $(TM).md/genextract $(TM).md/genpeep \
  30.             $(TM).md/genoutput
  31. #
  32. # The targets below are for a bunch of utility programs used to generate
  33. # C files for machine-dependent aspects of the compiler.  Things are a
  34. # little tricky here:  these programs have to be generated to run on
  35. # the current machine ($MACHINE).
  36. #
  37.  
  38. MAKEGEN:    .USE $(TM).md/rtl.o $(TM).md/obstack.o $(LIBS)
  39.     $(RM) -f $(.TARGET)
  40.     $(CC) $(CFLAGS) -o $(.TARGET) $(.ALLSRC:N*.h:N*.def)
  41.  
  42. $(TM).md/genconfig        : $(SRCDIR)/genconfig.c MAKEGEN
  43. $(TM).md/genflags        : $(SRCDIR)/genflags.c MAKEGEN
  44. $(TM).md/gencodes        : $(SRCDIR)/gencodes.c MAKEGEN
  45. $(TM).md/genemit        : $(SRCDIR)/genemit.c MAKEGEN
  46. $(TM).md/genrecog        : $(SRCDIR)/genrecog.c MAKEGEN
  47. $(TM).md/genextract        : $(SRCDIR)/genextract.c MAKEGEN
  48. $(TM).md/genpeep        : $(SRCDIR)/genpeep.c MAKEGEN
  49. $(TM).md/genoutput        : $(SRCDIR)/genoutput.c MAKEGEN
  50.  
  51. #
  52. # Targets to generate the .o files that must be linked with the files
  53. # above.
  54.  
  55. MAKEOBJ:    .USE
  56.     $(RM) -f $(.TARGET)
  57.     $(CC) $(CFLAGS) -c -o $(.TARGET) $(.ALLSRC:N*.h:N*.def)
  58.  
  59. $(TM).md/obstack.o        : obstack.c MAKEOBJ
  60. $(TM).md/rtl.o            : rtl.c MAKEOBJ
  61.  
  62. #if exists($(TM).md/dependencies.mk)
  63. #include    "$(TM).md/dependencies.mk"
  64. #endif
  65.